-
-
Notifications
You must be signed in to change notification settings - Fork 74
Parse supportedOperations into Resource #28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Can anyone tell me why the
I also came already across this in the DocumentationNormalizer of the PHP library - the Best |
Collecting entrypoint operations and inject them into the resource's operations as well
Actually I wanted to add references to other resources here as well, e.g. for the return values - maybe this could be an extension of the last state. There are some unknowns which I did not handle explicitly because I don't know the reason for them:
Anyway, IMHO this is okay for now. |
Is there anyone willing to give some feedback on this? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK for me. @dunglas, what do you think?
Thanks @olivermack |
Hey,
as a user of this lib which consumes an api-platform hydra documentation I'd like to see the contents of the
supportedOperation
entries reflected inside theResource
objects which are generated by theparseHydraDocumentation
.Background: I've tweaked my API to provide context-sensitive documentation based on the user's privileges - thus, the
supportedOperation
entries are only visible in the api doc when the user is allowed to call that endpoint. To be honest, I did not get very deep into hydra but I hope there's no conceptual violation by using thesupportedOperation
in a context-sensitive manner. I'm pretty aware though that the hydra-documentation can be outdated or a statesupportedOperation
on documentation-read can become unsupported when the user invokes it some moments later.Why: I want to adjust my SPA in such a way that turns on/off certain functionalities based on those supportedOperations - basically using them as permission based feature flags.
What I did not implement yet is an according parsing of the
hydra:supportedClass#Entrypoint
specs.Best